package psd.scala;

import org.eclipse.jdt.core.dom.ASTNode;

import psd.model.ModelGenerator;
import psd.model.Prolog.Converters.PrologConstants;

public class ScalaModelGenerator extends ModelGenerator {

	private int factsCounter;
	private FactDb fdb = null;

	public ScalaModelGenerator(FactDb fdb) {
		super();
		this.fdb = fdb;
		this.setConverterFactory(new ScalaConverterFactory(fdb));
		factsCounter = 1;
	}
	
	public void preVisit(ASTNode node) {
		setNodeId(node);
	}

	private void setNodeId(ASTNode node) {
		node.setProperty(PrologConstants.PROLOG_ID_PROPERTY, factsCounter++);
	}

}
